package com.yuda.operationcenter.service;

import java.util.List;
import com.yuda.operationcenter.domain.OperInformation;
import org.apache.ibatis.annotations.Param;

/**
 * 资讯Service接口
 *
 * @author wyn
 * @date 2021-04-12
 */
public interface IOperInformationService
{
    /**
     * 查询资讯
     *
     * @param id 资讯ID
     * @return 资讯
     */
    public OperInformation selectOperInformationById(Long id);

    /**
     * 查询资讯列表
     *
     * @param operInformation 资讯
     * @return 资讯集合
     */
    public List<OperInformation> selectOperInformationList(OperInformation operInformation);

    /**
     * 新增资讯
     *
     * @param operInformation 资讯
     * @return 结果
     */
    public int insertOperInformation(OperInformation operInformation);

    /**
     * 修改资讯
     *
     * @param operInformation 资讯
     * @return 结果
     */
    public int updateOperInformation(OperInformation operInformation);

    /**
     * 批量删除资讯
     *
     * @param ids 需要删除的资讯ID
     * @return 结果
     */
    public int deleteOperInformationByIds(Long[] ids);

    /**
     * 删除资讯信息
     *
     * @param id 资讯ID
     * @return 结果
     */
    public int deleteOperInformationById(Long id);

    int batchUpdateSellStatus(Long[] ids, int on_sell);
    int batchUpdateSellStatus(Long id, int on_sell,int MaxOrderNo);
    int removeImage(Long id);

    int checkIsCanUpdateStatus(Long id);








    public List<OperInformation> selectOperInformation_OrderNo_null(Long[] ids);
    //查询order_no字段不为空的对象
    public List<OperInformation> selectOperInformation_OrderNo_Notnull();

    //获取未选中的图文
    public List<OperInformation> UnSelected(@Param("ids") Long[] ids);
    //更新未选中图文的排序值
    public int updateUnSelectedOrderNo(long id,int NewOrder);


    //找出最大排序值
    public Integer MaxOrderNo();

    //根据id把更改order_no
    public int updateOrderNo( @Param("id") long id, @Param("orderNo") int orderNo);

    public int updateOrderNo(long id1 , int order2, long id,int orderNo);


    //根据ids数组查出的图文集合
    public List<OperInformation> selectd(Long[] ids);
    //根据id查出的单个图文
    public OperInformation selectOne(long id);

    //下架改order_no为：0
    public int updateOrder(@Param("id") long id);

    //下架一些咨询后更新其他咨询的order值变为连续，size是被下架咨询数组的长度
    public OperInformation continuousOrder(@Param("id") long id,int size);

    //根据排序值获取对象
    public OperInformation selectedByOrder(@Param("orderNo") int orderNo);


    //使大于参数值得order自动加一
    public int updateOrder1(@Param("orderNo1") int orderNo1,@Param("orderNo2") int orderNo2);
    //使大于参数值得order自动减一
    public int updateOrder2(@Param("orderNo1") int orderNo1,@Param("orderNo2") int orderNo2);

    int orderAddOne(int minOrder,int maxOrder);

    boolean existOrder(Integer orderNo);

    OperInformation selectedByOrderAndSellEq1(int order1);

    boolean checkIsUsed(Long[] ids);

    List<OperInformation> selectByIds(Long[] ids);//通过输入的id数组，查出对应的咨询集合





}
